﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;

namespace MINERP.DAL.CustomerManage
{
    public class TalkRecordDAL : DALBase
    {
        /// <summary>
        /// 得到一个订单的所有和商户进行的沟通记录
        /// </summary>
        /// <param name="bagid"></param>
        /// <returns></returns>
        public static List<Tb_TalkRecords> GetTalkRecordByBagID(int bagid)
        {
            ObjectQuery<Tb_TalkRecords> list = DataEntites.Tb_TalkRecords.Where(string.Format("it.Tb_OrderBag.OrderBagId = {0}", bagid)).Include("users").Include("Tb_OrderBag");

            List<Tb_TalkRecords> collection = new List<Tb_TalkRecords>();

            foreach (Tb_TalkRecords record in list)
            {
                collection.Add(record);
            }

            return collection;
        }
    }
}
